package com.example.number1.ui.theme;

import android.os.Bundle;
import android.os.Handler;
import android.widget.TextView;


import androidx.appcompat.app.AppCompatActivity;

import com.example.number1.R;

public class MainActivity extends AppCompatActivity {




    private TextView mytext;
    private Handler handler;
    private Runnable runnable;
    private int theroll=0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        TextView textView = findViewById(R.id.textView); // 替换为你的控件id
        textView.setSelected(true);



    }


/*    private void initView() {
        //实例化
        mytext = (TextView) findViewById(R.id.mytext);
    }
    //滚动的具体代码
    private void marquee(){
        handler=new Handler();
        runnable=new Runnable() {
            @Override
            public void run() {
                if (theroll>800){
                    theroll=-80;
                }
                theroll=theroll+2;
                //通过设置下面的四个参数可以起到控制滚动方向的作用
                mytext.setPadding(theroll,0,0,0);
                handler.postDelayed(this,10);//可调整速度
            }
        };
        handler.postDelayed(runnable,0);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //在最后记得要关掉定时器
        handler.removeCallbacks(runnable);
    }*/
}
